package ex;

public class ex7 {
    public static void main(String[] args) {
        confirmResoult(1,1,-5);
    }
    public static boolean confirmResoult(double a,double b,double c){
        double delta = b * b - 4 * a * c;
        if (delta>=0){
            double x1 = (-b + Math.sqrt(delta))/(2*a);
            double x2 = (-b - Math.sqrt(delta))/(2*a);
            if(delta==0){
                System.out.println(x1);
            }else {
                System.out.println(x1+""+x2);
            }
            return true;
        }else {
            System.out.println("无解");
            return false;

        }
    }
}
